<!doctype html>
<html>
<head>
<meta name="Generator"  />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>我的订单</title>
<meta name="Keywords" content="Call管家" />
<meta name="Description" content="Call管家" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

<link rel="stylesheet" href="__HOMECSS__/style.css">

<link rel="stylesheet" type="text/css" href="__HOMECSS__/mobileSelect.css">
</head>

<body>

<ul class="coupon_top myorder_top">
    <li><a {if condition="(input('status') eq null) "}class="coupon_topthis"{/if} data-key="all">全部</a></li>
    <li><a {if condition="(input('status') eq 1) "}class="coupon_topthis"{/if} data-key="1">待付款</a></li>
    <li><a {if condition="(input('status') eq 2) "}class="coupon_topthis"{/if} data-key="2">进行中</a></li>
    <li><a {if condition="(input('status') eq 3) "}class="coupon_topthis"{/if} data-key="3">已完成</a></li>
</ul>
<ul class="myorder_all">
</ul>

{include file="Public/footer" /}
</body>
<script src="__HOMEJS__/jquery-1.7.2.min.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script src="__HOMEJS__/mobileSelect.js" type="text/javascript"></script>

<script>
    $(function () {
        $(".coupon_top li").click(function () {
            $(".coupon_top li").find("a").removeClass('coupon_topthis')
            $(this).find("a").addClass('coupon_topthis')

            var index = $(this).index()
            $(".myorder_all>li").css({
                "display":"none",
            })
            $(".myorder_all>li").eq(index).css({
                "display":"block",
            })

        })

    })
    $(window).load(function(){
        ajax_order_list();
    })

        //取消订单弹窗
    var weekdayArr=['不想买了','发布太久无人接单','下单信息填错','其他原因'];
    var mobileSelect1 = new MobileSelect({
        trigger: '#trigger1',
        trigger1: '#trigger2',
        trigger2: '#trigger3',

        wheels: [
            {data: weekdayArr}
        ],
        position:[2], //初始化定位 打开时默认选中的哪个 如果不填默认为0
        transitionEnd:function(indexArr, data){
            console.log(data);
        },
        callback:function(indexArr, data){
            console.log(data);
        }
    });
    
     $('.myorder_top li a').click(function(){
        $(".myorder_top li a").removeClass('coupon_topthis')
        $(this).addClass('coupon_topthis')
        var indexs = $(this).index();
        ajax_order_list();
     })
     function ajax_order_list(){
    	var index = layer.load();
        
    	var status = $('.coupon_topthis').data('key');
    	$.ajax({
    		type:"post",
    		url:"{:Url('User/ajax_get_order_list')}",
    		dataType:'json',
    		data:{status:status},
    		success:function(res){
    			layer.close(index);
    			if(res.code==1){
    				$('.myorder_all').html(res.msg);
    			}
    		}
    	});
    }

</script>
</html>
